package com.sen.demo.MQ;

import com.sen.demo.controller.WarningPushSocket;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Component
public class ActiveMQServer {

    @Autowired(required = false)
    WarningPushSocket warningPushSocket;

    @JmsListener(destination = "name")
    public void receive(String message) throws IOException {
        warningPushSocket.sendMsg("admin", message);
    }
}
